<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : Visual Source Safe Source Control Block</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : Visual Source Safe Source Control Block
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Sep 11, 2008 by <font color="#0050B2">williams</font>.
				    </div>

				    <h3><a name="VisualSourceSafeSourceControlBlock-VSSConfigurationExample"></a>VSS Configuration Example</h3>

<p>For Visual Source Safe you must specify the executable, project, username and password. You may also specify the SSDIR. If SSDIR is not set the default or the SSDIR environment variable will be used.</p>

<h4><a name="VisualSourceSafeSourceControlBlock-Minimalconfigurationexample%3A"></a>Minimal configuration example:</h4>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"vss"</span> /&gt;</span></pre>
</div></div>

<h4><a name="VisualSourceSafeSourceControlBlock-Fullconfigurationexample%3A"></a>Full configuration example:</h4>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;sourcecontrol type=<span class="code-quote">"vss"</span>&gt;</span>
   <span class="code-tag">&lt;executable&gt;</span>C:\Program Files\Microsoft Visual Studio\VSS\win32\SS.EXE<span class="code-tag">&lt;/executable&gt;</span>
   <span class="code-tag">&lt;project&gt;</span>$/CCNET<span class="code-tag">&lt;/project&gt;</span>
   <span class="code-tag">&lt;username&gt;</span>buildguy<span class="code-tag">&lt;/username&gt;</span>
   <span class="code-tag">&lt;password&gt;</span>buildguypw<span class="code-tag">&lt;/password&gt;</span>
   <span class="code-tag">&lt;ssdir&gt;</span>c:\repos\<span class="code-tag">&lt;/ssdir&gt;</span>
   <span class="code-tag">&lt;applyLabel&gt;</span>false<span class="code-tag">&lt;/applyLabel&gt;</span>
   <span class="code-tag">&lt;autoGetSource&gt;</span>true<span class="code-tag">&lt;/autoGetSource&gt;</span>
   <span class="code-tag">&lt;alwaysGetLatest&gt;</span>false<span class="code-tag">&lt;/alwaysGetLatest&gt;</span>
   <span class="code-tag">&lt;workingDirectory&gt;</span>c:\myBuild<span class="code-tag">&lt;/workingDirectory&gt;</span>
   <span class="code-tag">&lt;culture&gt;</span>fr-FR<span class="code-tag">&lt;/culture&gt;</span>
   <span class="code-tag">&lt;cleanCopy&gt;</span>false<span class="code-tag">&lt;/cleanCopy&gt;</span>
   <span class="code-tag">&lt;timeout units=<span class="code-quote">"minutes"</span>&gt;</span>10<span class="code-tag">&lt;/timeout&gt;</span>
<span class="code-tag">&lt;/sourcecontrol&gt;</span></pre>
</div></div>

<h3><a name="VisualSourceSafeSourceControlBlock-ConfigurationElements%3A"></a>Configuration Elements:</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Node </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Required </th>
</tr>
<tr>
<td class='confluenceTd'> project </td>
<td class='confluenceTd'> The project in the repository to be monitored. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> $/ </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> username </td>
<td class='confluenceTd'> VSS user ID that CCNet should use to authenticate. If the username is unspecified, the VSS client will attempt to authenticate using the NT user. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> null </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> password </td>
<td class='confluenceTd'> Password for the VSS user ID </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> N/A </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> ssdir </td>
<td class='confluenceTd'> The directory containing SRCSAFE.INI.  If this SSDIR environment variable is already set then this property may be omitted. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> N/A </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> executable </td>
<td class='confluenceTd'> The location of SS.EXE.  If VSS is installed on the integration server, the location of VSS will be read from the registry and this element may be omitted. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> value from registry </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> autoGetSource </td>
<td class='confluenceTd'> Specifies whether the current version of the source should be retrieved from VSS </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> true </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> applyLabel </td>
<td class='confluenceTd'> Specifies whether the current CCNet label should be applied to all source files under the current project in VSS.  Note: the specified VSS username must have write access to the repository. </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> alwaysGetLatest </td>
<td class='confluenceTd'> Specifies whether the most recent version of the source should be retrieved from VSS.  If not, CCNet will obtain the source as of the time the build began. </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> workingDirectory </td>
<td class='confluenceTd'> The folder into which the source should be retrived from VSS.  If this folder does not exist, it will be automatically created </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> N/A </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> timeout </td>
<td class='confluenceTd'> Sets the timeout period for the source control operation. See <a href="Timeout Configuration.html" title="Timeout Configuration">Timeout Configuration</a> for details. </td>
<td class='confluenceTd'> Timeout </td>
<td class='confluenceTd'> 10 minutes </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> culture </td>
<td class='confluenceTd'> The culture under which VSS is running.  This value must match the culture of the VSS installation for CCNet to work with VSS.  Most of the time the default is OK and you may omit this item. If you are using the US version of VSS on a machine that is not set to the US culture, you should include the configuration block &lt;culture&gt;en-US&lt;/culture&gt;. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> the culture of the VSS installation </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> cleanCopy </td>
<td class='confluenceTd'> Controls whether or not VSS gets a clean copy (overwrites modified files) when getting the latest source. </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> true </td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> issueUrlBuilder </td>
<td class='confluenceTd'> Converts the comment (or parts from it) into an url pointing to the issue for this build. <br clear="all" />
See <a href="IssueUrlBuilder.html" title="IssueUrlBuilder">Issue Builder</a> for more details <br clear="all" /> </td>
<td class='confluenceTd'> Group </td>
<td class='confluenceTd'> N/A </td>
<td class='confluenceTd'> false <br clear="all" /> </td>
</tr>
</tbody></table>

<h3><a name="VisualSourceSafeSourceControlBlock-GettingthelatestsourcewithVSS"></a>Getting the latest source with VSS</h3>

<p>VSS does not automatically remove files from the local workspace that have been deleted from the VSS database.  This does not cause a problem if you are using the <b>&lt;solution&gt;</b> task or the <a href="Visual Studio Task.html" title="Visual Studio Task">Visual Studio Task</a> to compile your project.  However, if you are packaging the source for deployment or if you are using the <b>&lt;csc&gt;</b> task to produce a custom build, you may end up compiling these deleted files in your assembly.  To be on the safe side, it might be a good idea to clear the contents of the local workspace after each build.</p>

<h3><a name="VisualSourceSafeSourceControlBlock-UsingaUSEnglishVSSinanonEnglishculture"></a>Using a US English VSS in a non-English culture</h3>

<p>If you use an English VSS with machines configured to use a non-English culture, it may happen that CCNet will not detect any modifications after you check-in some code.  The reason for this behaviour is that CCNet uses the selected culture on the build server to determine the language it expects VSS will output for parsing.  For example, with <b>fr-CA</b>, CCNet looks for French keywords in the VSS output.  Hence, if your VSS installation does not use the same language, CCNET will not be able to detect any modification.</p>

<p>If you're using a US VSS installation, the first step in solving this problem is to include a configuration block  set to the US english culture (&lt;culture&gt;en-US&lt;/culture&gt;).  This will make CCNet look for English VSS keywords, and eventually detect modifications.</p>

<h3><a name="VisualSourceSafeSourceControlBlock-VSSIssues"></a>VSS Issues</h3>

<p><b>CCNet periodically reports the following error when connecting to VSS: "Unable to open user login file \SourceSafe\Vss60\data\loggedin\&lt;userid&gt;.log."  What gives?</b></p>

<p>If you have set CCNet up to manage multiple projects that all connect to the VSS repository using the same user id then you may sporadically receive this failure.  Our analysis suggests that the root of the problem is caused by the fact that VSS will create the <b>&lt;userid&gt;.log</b> file when a user logs into VSS and delete it when the user logs out again.  If a second build is using the repository concurrently with the same user, when that second build logs out it looks for <b>&lt;userid&gt;.log</b>, but it's gone.  Hence the error.</p>

<p>There are three approaches that you can take to deal with this:</p>
<ul>
	<li>Log into VSS using different users for each CCNet project.</li>
	<li>You can <a href="Project Configuration Block.html#ProjectConfigurationBlock-publishExceptions">keep CCNet from publishing exceptions </a>, so this exception will just get logged into the <b>ccnet.log</b> file.</li>
	<li>Leave the VSS GUI open on the integration server.  This will mean the <b>userid.log</b> file never gets deleted.</li>
</ul>


<p><b>If you're using a labeller that returns a label equal to one already applied in the repository, the old label will be</b> <b><ins>deleted</ins></b> <b>when the new one is added.</b></p>

<p>This is because of a quirk in how VSS deals with labels of the same name; it should not be a problem with the default labeller.</p>

<p>This problem usually occurs when someone is using a custom labeller (a class that implements ILabeller) and that custom labeller returns a constant value.</p>

<p><b>Workaround:</b> If you use a custom labeller, make sure each label is unique.</p>

<p><b>When I try to connect to use the &lt;vss&gt; NAntContrib tasks from ccservice I get this error:  Failed to open database \\someserver\someshare\vssrep\srcsafe.ini</b></p>

<p>There are a number of known issues with SourceSafe 6.0c.  Make sure that you upgrade to the 6.0d version.</p>

<p><b>When I try connecting to VSS when using</b> <b><a href="The Server Service Application.html" title="The Server Service Application"><b>ccservice</b></a></b> <b>I get the error: No VSS database (srcsafe.ini) found. Use the SSDIR environment variable or run netsetup.</b></p>

<p>Make sure that you are running <a href="The Server Service Application.html" title="The Server Service Application">ccservice</a> using an account that has the necessary permissions to access the network share where your VSS database is set up.  By default <a href="The Server Service Application.html" title="The Server Service Application">ccservice</a> will run as the LocalSystem account, which does not have the necessary priviledges to access other machines.</p>

<p><b>When using VSS with a</b> <b><a href="Filtered Source Control Block.html" title="Filtered Source Control Block">Filtered Source Control Block</a></b><b>, newly added or removed files don't show up as modifications</b></p>

<p>VSS does not output the paths for added or deleted files.  As a result, the modifications returned by CCNet do not have any specified path information.  If a <a href="Filtered Source Control Block.html" title="Filtered Source Control Block">Filtered Source Control Block</a> is used with a path filter then these modifications are likely to be filtered out.  This is an outstanding issue.</p>

<h3><a name="VisualSourceSafeSourceControlBlock-UsefulLinks%3A"></a>Useful Links:</h3>

<ul>
	<li><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvss/html/vssbest.asp">Visual SourceSafe Best Practices Guide</a></li>
	<li><a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;248240&amp;Product=vss">Using VSS With Multiple Timezones</a></li>
	<li><a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;837417">OLE Automation interface Get method behaves differently with VSSVersion and with VSSItem</a></li>
</ul>


<h3><a name="VisualSourceSafeSourceControlBlock-Reasonswhyyoumightwanttoconsideradifferentversioncontrolsystem%3A"></a>Reasons why you might want to consider a different version control system:</h3>

<ul>
	<li><a href="http://www.highprogrammer.com/alan/windev/sourcesafe.html">Visual SourceSafe: Microsoft's Source Destruction System</a></li>
	<li><a href="http://www.michaelbolton.net/testing/VSSDefects.html">Visual SourceSafe Version Control: Unsafe at any Speed?</a></li>
	<li><a href="http://better-scm.berlios.de/comparison/comparison.html">Look here for a comparison list of alternatives</a></li>
</ul>


				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>